package com.design.pattern.structuremode.composite;

/**
 * 结构型模式-组合模式
 * @author yll
 * @version 1.0.0
 * @date 2024/03/21 20：37
 * @desc 组合接口实现类，具有实际的操作
 * */
public class Composite extends IComponent {

    public Composite(String name) {
        super(name);
    }

    @Override
    public void add(IComponent component) {
        getComponentList().add(component);
    }

    @Override
    public void remove(IComponent component) {
        getComponentList().remove(component);
    }
}
